#include "errordict.h"

QMap<QString,QString> ErrorDict::errorList;

void ErrorDict::Init()
{
    errorList = QMap<QString,QString>();
    errorList.insert("LOGIN_ALREADY_USED","Login is used already");
    errorList.insert("NOT_AUTHORIZED","Sorry, you have not been authorized");
    errorList.insert("LOGIN_EXISTS","Login already exists");
    errorList.insert("WRONG_LOGIN_CHARS", "Wrong symbols in login");
    errorList.insert("WRONG_PASS_CHARS", "Wrong symbols in password");
    errorList.insert("WRONG_PASS_FOR_ROOM","Wrong Password!");
    errorList.insert("YOU_ARE_BANNED","Sorry, you was banned");
    errorList.insert("NO_SUCH_ROOM","This room does not exist");
    errorList.insert("YOU_ARE_NOT_IN_ROOM", "You are not in this room");
    errorList.insert("MESSAGE_EMPTY", "Message was empty\nplease do not do this");
    errorList.insert("NO_PERMISSIONS","Not permitted");
    errorList.insert("WRONG_DESCRIPTION","Description was wrong");
}

QString ErrorDict::getMessage(QString cause)
{
    return errorList.value(cause);
}
